package com.tfswue.lsh.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

//标注当前类是一个Controller类，控制层，@ResponseBody注解（返回json数据），@controller组合

@RestController
public class HelloController {
    @Value("${email}")
    private  String email;
    @Value("${my1.email}")
    private String my1Email;
    @Value("${city1[0]}")
    private  String city1;
    @Value("${sxt[0].mobile}")
    private String mobile;
    @RequestMapping("/hello")
    public String hello() {
        return "hello world";

    }

    @RequestMapping("/getvalue")
    public  String getValue() {
        return "email:" + email + "my1Email:" + my1Email + "city1:" + city1 + "mobile:" + mobile;
    }
        @RequestMapping("/email")
        public String email() {
            return email;

    }
}
